<title>Zipcode</title>
<h2>Zipcode</h2>
<div id="view-content">
    <div class="row-fluid">
        <div class="span4">
            <div class="well span10">
                <h3>Add New</h3>
                <?php
                if($this->errorMessage!=null){ ?>
                <div class="alert alert-danger">
                    <?=$this->errorMessage?>
                </div>
               <?php }
                ?>
                <?= $this->form ?>
            </div>
        </div>
        <div class="span6 well">
            <h3>List</h3>
            <table class="table">
                <thead>
                    <tr>
                        <th>#</th>
                        <th>Zip Code</th>
                        <th>City</th>
                        <th>State</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php
                    $index = 1;
                    foreach ($this->allData as $data) :
                        ?>
                        <tr>
                            <td><?= $index ?></td>
                            <td><?= $data['zipcode']['code'] ?></td>
                            <td><?= $data['city']['name'] ?></td>
                            <td><?= $data['state']['name'] ?></td>
                            <td><td><a class="btn btn-small" href="<?= $this->url(array('id' => $data['zipcode']['id']), 'zip-update'); ?>"><i class="icon-edit"></i> Edit</a></td></td>
                        </tr>
                        <?php
                        $index++;
                    endforeach;
                    ?>
                </tbody>
            </table>
        </div>
    </div>
</div>